<?php

declare(strict_types=1);

namespace App\AiPro\Model;

use Mine\MineModel;

/**
 * @property int $id 
 * @property int $aipro_category_id 分类id
 * @property string $title 标题
 * @property string $img 图片
 * @property string $link 地址
 * @property string $desc 简介
 * @property int $sort 权重
 * @property string $status 状态,1=正常,2=隐藏
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 */
class AiproWebsite extends MineModel
{
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'aipro_website';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'aipro_category_id', 'title', 'img', 'link', 'desc', 'sort', 'status', 'created_at', 'updated_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'aipro_category_id' => 'integer', 'sort' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    /**
     * 定义 aipro_category 关联
     * @return \Hyperf\Database\Model\Relations\belongsTo
     */
    public function aipro_category() : \Hyperf\Database\Model\Relations\belongsTo
    {
        return $this->belongsTo(\App\AiPro\Model\AiproCategory::class, 'id', 'aipro_category_id');
    }

}
